package com.henry.matrix;

import java.util.Arrays;
import java.util.stream.Stream;

public class MatrixDemo {
    public static void main(String[] args) {
        Matrix A = new Matrix(3, 3, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9});
        Matrix B = new Matrix(3, 3, "9, 8, 7, 6, 5, 4, 3, 2, 1  ", "\\s*,\\s*");

        System.out.println("A = \n" + A);
        System.out.println("B = \n" + B);
        System.out.println(A.transpose());

        Matrix C = new Matrix(2, 4, new int[] {3, 2, 1, 5, 9, 1, 3, 0});
        Matrix D = new Matrix(4, 3, "2, 9, 0, 1, 3, 5, 2, 4, 7, 8, 1, 5", "\\s*,\\s*");
        System.out.println("C = \n" + C);
        System.out.println("D = \n" + D);
        System.out.println("D.transpose() = \n" + D.transpose());
        System.out.println("C * D = \n" + C.multiply(D));
    }
}
